//
//  WJBaseViewController.m
//  WJBSApp
//
//  Created by dllo on 16/7/13.
//  Copyright © 2016年 王景伟. All rights reserved.
//

#import "WJBaseViewController.h"

@interface WJBaseViewController ()

@end

@implementation WJBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.edgesForExtendedLayout = UIRectEdgeNone;
    [self changeColor];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor) name:@"changeColor" object:nil];
}

- (void)changeColor {
    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"]) {
        self.view.backgroundColor = FORBLACKCOLOR;
    }else{
        self.view.backgroundColor = BSWhiteColor;
    }
}

// 销毁观察者
- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}
@end
